
package galaxy.app.dispatch.disruptor;

import com.lmax.disruptor.EventHandler;

/**
 */
public class MessageEventHandler implements EventHandler<MessageBuffer> {


    public MessageEventHandler() {
    }

    @Override
    public void onEvent(MessageBuffer buffer, long sequence, boolean endOfBatch) throws Exception {
        try {
            buffer.execute();

        } catch (Exception ex) {
            throw ex;
        } finally {
            buffer.clear();
        }
    }
}
